package hn.cch.advanced.thread;

public class ImplementsRunnable implements Runnable {
    //实现Runnable接口的run方法
    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("runnable=" + Thread.currentThread().getName());
        }
    }

    public static void main(String[] args) {

        ImplementsRunnable implementsRunnable = new ImplementsRunnable();
        Thread thread = new Thread(implementsRunnable);
        thread.start();
    }


}
